package com.example.test.启动线程.死锁;

public class B implements Runnable {

    @Override
    public void run() {
        printB();
    }

    public synchronized static void printB(){
        System.out.println("B");
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("开始死锁");
        A.printA();
    }
}
